Install the header files and static libraries for python dev. Use your package manager to install them system-wide.
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo yum install python-devel